ValueFolder2='/sps/isc/rneveu/EtudeIRM/Nature/ResultsRetracted/';
ValueFolderTemp='/sps/isc/rneveu/EtudeIRM/Nature/ResultsJournal/';
load([ValueFolder2 'AnalyseAuthorsRetractedArticleBeforeAfter.mat']);
VecResultsRetracted2=zeros(size(VecAuthorsRetracted,1),1);
for n1=1:size(VecAuthorsRetracted,1)
    ValueDate=VecAuthorsRetracted{n1,3};
    if ValueDate(1,1)>=1990
        VecResultsRetracted2(n1,1)=1;
    end
end
VecResultsTemp=zeros(111,1);
VecResultsRetractedAfterTemp=[];
VecResultsOriginalTemp=[];
VecResults6=[];
for n3=0:11
    VecResults=zeros(2,3);
    VecResultsOriginal2=zeros(2,1);
    VecResults5=[];
    for n1=1:size(VecAuthorsRetracted,1)
        VecValueTemp=dir([ValueFolder2 'ResultsRetractedAuthors' num2str(n1) 'ArticleBeforeAfter' num2str(n3) '.mat']);
        if size(VecValueTemp,1)==1&&VecResultsRetracted2(n1,1)==1
            load([ValueFolder2 VecValueTemp(1,1).name]);
            VecResultsOriginal2=VecResultsOriginal2+VecResultsOriginal(:,2);
            VecResultsTemp(n1,1)=VecResultsTemp(n1,1)+1;
            VecResults5=[VecResults5;VecResultsRetracted(:,2)';VecResultsRetracted(:,end)'];
        end
    end
    VecResultsOriginalTemp=[VecResultsOriginalTemp VecResultsOriginal2];
    VecValueTemp=find(VecResults5(:,1)<=15&VecResults5(:,2)<=15);
    VecValueTemp2=[sum(VecResults5(VecValueTemp,1));sum(VecResults5(VecValueTemp,2))];
    VecResultsRetractedAfterTemp=[VecResultsRetractedAfterTemp VecValueTemp2];
    [ValueTemp,ValueTemp2]=ttest(VecResults5(VecValueTemp,1),VecResults5(VecValueTemp,2));
    [ValueTemp3,ValueTemp4]=signrank(VecResults5(VecValueTemp,1),VecResults5(VecValueTemp,2));
    VecResults6=[VecResults6;n3+1 mean(VecResults5(VecValueTemp,2)-VecResults5(VecValueTemp,1)) sqrt(var(VecResults5(VecValueTemp,2)-VecResults5(VecValueTemp,1))) sqrt(var(VecResults5(VecValueTemp,2)-VecResults5(VecValueTemp,1)))/sqrt(size(VecValueTemp,1)) ValueTemp2 ValueTemp3];
end

VecResults61=[];
for n1=1:size(VecResultsRetractedAfterTemp,2)
    [ValueTemp,ValueTemp2]=fishertest([VecResultsRetractedAfterTemp(:,n1) VecResultsOriginalTemp(:,n1)]);
    VecResults61=[VecResults61;VecResultsRetractedAfterTemp(2,n1)/VecResultsRetractedAfterTemp(1,n1)*100 VecResultsOriginalTemp(2,n1)/VecResultsOriginalTemp(1,n1)*100 VecResultsRetractedAfterTemp(2,n1) VecResultsRetractedAfterTemp(1,n1) VecResultsOriginalTemp(2,n1) VecResultsOriginalTemp(1,n1) ValueTemp2];
end

save([ValueFolderTemp 'AnalyseRetractedArticles.mat'],'VecResults6','VecResults61');

    


